import request from '@/utils/request'

// 查询省份列表（分页）
export function listProvince(query) {
  return request({
    url: '/house/province/list',
    method: 'get',
    params: query
  })
}

// 查询省份列表（不分页，用于下拉选择）
export function listProvinceOptions(query) {
  return request({
    url: '/house/province/list',
    method: 'get',
    params: {
      ...query,
      pageSize: 999
    }
  })
}

// 查询省份详细
export function getProvince(provinceId) {
  return request({
    url: '/house/province/' + provinceId,
    method: 'get'
  })
}

// 新增省份
export function addProvince(data) {
  return request({
    url: '/house/province',
    method: 'post',
    data: data
  })
}

// 修改省份
export function updateProvince(data) {
  return request({
    url: '/house/province',
    method: 'put',
    data: data
  })
}

// 删除省份
export function delProvince(provinceId) {
  return request({
    url: '/house/province/' + provinceId,
    method: 'delete'
  })
} 